PROJECT( sample )
cmake_minimum_required(VERSION 2.8)

SET( GUI main_gui.cpp)

FILE(GLOB negocio negocio/*.* negocio/impl/*.*)
FILE(GLOB persistencia persistencia/*.* persistencia/impl/*.*)

FILE(GLOB SAMPLE_SRCS apresentacao/*.c* apresentacao/impl/*.c*)
FILE(GLOB SAMPLE_MOC_HDRS apresentacao/*.h)
FILE(GLOB SAMPLE_UIS apresentacao/*.ui)

ADD_DEFINITIONS( -Wall )
SET( QT_USE_QT3SUPPORT TRUE )   
SET( QT_USE_QTXML TRUE )
FIND_PACKAGE( Qt4 REQUIRED )
INCLUDE( ${QT_USE_FILE} )
QT4_WRAP_UI( SAMPLE_UI_HDRS ${SAMPLE_UIS} )
QT4_WRAP_CPP( SAMPLE_MOC_SRCS ${SAMPLE_MOC_HDRS} )
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )

ADD_EXECUTABLE( main main.cpp ${negocio} ${persistencia})

ADD_EXECUTABLE( main_gui ${GUI} ${SAMPLE_SRCS} ${SAMPLE_MOC_SRCS} ${SAMPLE_UI_HDRS} ${apresentacao} ${negocio} ${persistencia})
TARGET_LINK_LIBRARIES( main_gui ${QT_LIBRARIES} )
